package com.wyc.apiPassenger.feign;

import com.wyc.internalCommon.request.OrderInfo;
import com.wyc.internalCommon.result.ApiResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("service-order")
public interface OrderFeignClient {

    /**
     * 添加订单
     * @param order
     * @return
     */
    @PostMapping("/order/add")
    ApiResult<OrderInfo> add(@RequestBody OrderInfo order);

    /**
     * 取消订单
     * @param orderId
     * @param identity 取消人的身份标识（1.乘客 2.司机3.平台）
     * @return
     */
    @PostMapping("/order/cancel")
    ApiResult cancelOrder(@RequestParam("orderId") Long orderId, @RequestParam("identity") String identity);

}
